package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.FormGroupFieldAddDTO;
import org.jsola.hr.dto.FormGroupFieldBatchDTO;
import org.jsola.hr.dto.FormGroupFieldUpdateDTO;
import org.jsola.hr.dto.SiteFieldAddDTO;
import org.jsola.hr.query.FormGroupFieldQuery;
import org.jsola.hr.vo.FormGroupFieldListVO;
import org.jsola.hr.vo.FormGroupFieldVO;

import java.util.List;

/**
 * 表单字段
 *
 * @author zhr
 */
@Api(tags = "hr-表单字段")
public interface IFormGroupFieldControllerAPI {

    /**
     * 新增表单字段
     * @param formGroupFieldAddDTO 表单字段新增实体
     * @return 表单字段展示对象
     */
    @ApiOperation(value = "新增表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldAddDTO", dataType = "FormGroupFieldAddDTO", value = "新增表单字段", paramType = "body")
    })
    Result<FormGroupFieldVO> save(FormGroupFieldAddDTO formGroupFieldAddDTO);


    /**
     * 修改表单字段
     * @param formGroupFieldUpdateDTO 表单字段
     * @return 更新数量
     */
    @ApiOperation(value = "修改表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldUpdateDTO", dataType = "FormGroupFieldUpdateDTO", value = "修改表单字段", paramType = "body")
    })
    Result<Integer> update(FormGroupFieldUpdateDTO formGroupFieldUpdateDTO);

    /**
     * 批量编辑、新增、删除表单字段
     * @param formGroupFieldBatchDTO 要操作的表单字段
     * @return 操作之后的全部表单字段
     */
    @ApiOperation(value = "批量编辑、新增、删除表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldBatchDTO", dataType = "FormGroupFieldBatchDTO", value = "要操作的字段数据", paramType = "body")
    })
    Result batch(FormGroupFieldBatchDTO formGroupFieldBatchDTO);



    /**
     * 删除单个表单字段，彻底删除
     * @param formGroupFieldId 表单字段id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个表单字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldId", dataType = "Long", value = "表单字段id", paramType = "path"),
            @ApiImplicitParam(name = "check", dataType = "Boolean", value = "是否做校验", paramType = "query")
    })
    Result<Integer> delete(Long formGroupFieldId, Boolean check);


    /**
     * 批量删除表单字段，彻底删除
     * @param formGroupFieldIds 表单字段id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除表单字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldIds", dataType = "Long[]", value = "表单字段id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] formGroupFieldIds);


    /**
     * 根据表单字段id查询表单字段详情
     * @param formGroupFieldId 表单字段id
     * @return 表单字段详情
     */
    @ApiOperation(value="根据表单字段id查询表单字段详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldId", dataType = "Long", value = "表单字段id", paramType = "path")
    })
    Result<FormGroupFieldVO> findById(Long formGroupFieldId);


    /**
     * 查询表单字段
     * @param formGroupFieldQuery 表单字段查询参数
     * @return page
     */
    @ApiOperation(value="查询表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldQuery", dataType = "FormGroupFieldQuery", value = "表单字段查询参数", paramType = "query")
    })
    Result<List<FormGroupFieldListVO>> listAll(FormGroupFieldQuery formGroupFieldQuery);


     /**
     * 分页查询表单字段
     * @param formGroupFieldQuery 表单字段查询参数
     * @return page
     */
    @ApiOperation(value="分页查询表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "formGroupFieldQuery", dataType = "FormGroupFieldQuery", value = "表单字段查询参数", paramType = "query")
    })
    Result<Page<FormGroupFieldListVO>> page(FormGroupFieldQuery formGroupFieldQuery);


    /**
     * 新增表单字段
     * @param siteFieldAddDTO 表单字段新增实体
     * @return 表单字段展示对象
     */
    @ApiOperation(value = "新增表单字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "siteFieldAddDTO", dataType = "SiteFieldAddDTO", value = "新增表单字段", paramType = "body")
    })
    Result<FormGroupFieldVO> saveSiteField(SiteFieldAddDTO siteFieldAddDTO);
}

